package com.aiYouPms.common.model;

import lombok.Getter;
import lombok.NonNull;
import lombok.Setter;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import java.util.List;

@Setter
@Getter
public class AdminUser {
    private Integer id;
    private String username;
    private String password;
    private String nickname;
    private String avatarUrl;
    private String email;
    private String mobile;
    private String wechat;
    private String remark;
    private Integer status;
    private Long updatedAt;
    private Long createdAt;
    
    // 角色ID列表
    private List<Integer> roleIds;
    
    // 角色列表
    private List<Role> roles;

    public AdminUser() {
    }

    public void encodePassword(String rawPassword) {
        this.password = new BCryptPasswordEncoder().encode(rawPassword);
    }
}